Skip to content

[ciqlts9_6] xfrm: esp: avoid in-place decrypt on shared skb frags#1191

Closed
ciq-kernel-automation[bot] wants to merge 1 commit into
ciqlts9_6from
{jmaple}_ciqlts9_6
Closed

[ciqlts9_6] xfrm: esp: avoid in-place decrypt on shared skb frags#1191
ciq-kernel-automation[bot] wants to merge 1 commit into
ciqlts9_6from
{jmaple}_ciqlts9_6

Conversation

@ciq-kernel-automation

Copy link
Copy Markdown

Summary

This PR has been automatically created after successful completion of all CI stages.

Commit Message(s)

xfrm: esp: avoid in-place decrypt on shared skb frags

unpub-cve DIRTY-FRAG
commit-author Kuan-Ting Chen <h3xrabbit@gmail.com>
commit -
commit-source-sha f4c50a4034e62ab75f1d5cdd191dd5f9c77fdff4
commit-source kernel.org/netdev/net
upstream-diff |
    This kernel is missing both, whole blocks dropped
    * 7da0dde68486b2d5bd7c689a9b327b77efecdfd0
      - ip, udp: Support MSG_SPLICE_PAGE
    * 6d8192bd69bb431ef6b2558be3b5746b706cd252
      - ip6, udp6: Support MSG_SPLICE_PAGES
    The upstream has also droped udp_sendpage()
    * dc97391e661009eab46783030d2404c9b6e6f2e7
      - "sock: Remove ->sendpage*() in favour of sendmsg(MSG_SPLICE_PAGES)"
      Because of this the ESP backport is considered non-functional
      without the setting SKBFL_SHARED_FRAG

Test Results

✅ Build Stage

Architecture Build Time Total Time
x86_64 33m 0s 33m 54s
aarch64 18m 40s 19m 21s

✅ Boot Verification

✅ Kernel Selftests

Architecture Passed Failed Compared Against Status
x86_64 207 42 ciqlts9_6 ✅ No regressions
aarch64 154 45 ciqlts9_6 ✅ No regressions

✅ LTP Results

Architecture Passed Failed Compared Against Status
x86_64 N/A N/A ciqlts9_6 ⚠️ No baseline available
aarch64 N/A N/A ciqlts9_6 ⚠️ No baseline available

🤖 This PR was automatically generated by GitHub Actions
Run ID: 25527880785

unpub-cve DIRTY-FRAG
commit-author Kuan-Ting Chen <h3xrabbit@gmail.com>
commit -
commit-source-sha f4c50a4
commit-source kernel.org/netdev/net
upstream-diff |
    This kernel is missing both, whole blocks dropped
    * 7da0dde
      - ip, udp: Support MSG_SPLICE_PAGE
    * 6d8192b
      - ip6, udp6: Support MSG_SPLICE_PAGES
    The upstream has also droped udp_sendpage()
    * dc97391
      - "sock: Remove ->sendpage*() in favour of sendmsg(MSG_SPLICE_PAGES)"
      Because of this the ESP backport is considered non-functional
      without the setting SKBFL_SHARED_FRAG

MSG_SPLICE_PAGES can attach pages from a pipe directly to an skb. TCP
marks such skbs with SKBFL_SHARED_FRAG after skb_splice_from_iter(),
so later paths that may modify packet data can first make a private
copy. The IPv4/IPv6 datagram append paths did not set this flag when
splicing pages into UDP skbs.

That leaves an ESP-in-UDP packet made from shared pipe pages looking
like an ordinary uncloned nonlinear skb. ESP input then takes the no-COW
fast path for uncloned skbs without a frag_list and decrypts in place
over data that is not owned privately by the skb.

Mark IPv4/IPv6 datagram splice frags with SKBFL_SHARED_FRAG, matching
TCP. Also make ESP input fall back to skb_cow_data() when the flag is
present, so ESP does not decrypt externally backed frags in place.
Private nonlinear skb frags still use the existing fast path.

This intentionally does not change ESP output. In esp_output_head(),
the path that appends the ESP trailer to existing skb tailroom without
calling skb_cow_data() is not reachable for nonlinear skbs:
skb_tailroom() returns zero when skb->data_len is nonzero, while ESP
tailen is positive. Thus ESP output will either use the separate
destination-frag path or fall back to skb_cow_data().

Fixes: cac2661 ("esp4: Avoid skb_cow_data whenever possible")
Fixes: 03e2a30 ("esp6: Avoid skb_cow_data whenever possible")
Fixes: 7da0dde ("ip, udp: Support MSG_SPLICE_PAGES")
Fixes: 6d8192b ("ip6, udp6: Support MSG_SPLICE_PAGES")
	Reported-by: Hyunwoo Kim <imv4bel@gmail.com>
	Reported-by: Kuan-Ting Chen <h3xrabbit@gmail.com>
	Tested-by: Hyunwoo Kim <imv4bel@gmail.com>
	Cc: stable@vger.kernel.org
	Signed-off-by: Kuan-Ting Chen <h3xrabbit@gmail.com>
	Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
(cherry picked from commit f4c50a4)
Signed-off-by: Jonathan Maple <jmaple@ciq.com>
@ciq-kernel-automation ciq-kernel-automation Bot added the created-by-kernelci Tag PRs that were automatically created when a user branch was pushed to the repo (kernelCI) label May 8, 2026
@github-actions

github-actions Bot commented May 8, 2026

Copy link
Copy Markdown

🤖 Validation Checks In Progress Workflow run: https://github.com/ctrliq/kernel-src-tree/actions/runs/25533109913

@github-actions

github-actions Bot commented May 8, 2026

Copy link
Copy Markdown

Validation checks completed successfully View full results: https://github.com/ctrliq/kernel-src-tree/actions/runs/25533109913

@PlaidCat PlaidCat closed this May 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

created-by-kernelci Tag PRs that were automatically created when a user branch was pushed to the repo (kernelCI)

Development

Successfully merging this pull request may close these issues.

1 participant